import { _ as _export_sfc, z as ref, al as useNavbarHeight, B as onLoad, a3 as showToast, c as createBlock, w as withCtx, n as normalizeStyle, H as unref, i as index$g, j as resolveEasycom, k as resolveDynamicComponent, o as openBlock, b as createVNode, s as index$i, t as createTextVNode, e as createCommentVNode, u as toDisplayString, f as normalizeClass, g as createElementBlock, F as Fragment, h as renderList, p as index$q, a2 as makePhoneCall, av as openLocation, a7 as hideLoading, a6 as setStorageSync, I as switchTab, V as getStorageSync } from './index-Cc4oxzDN.js';
import { _ as __easycom_1 } from './uv-loading-icon.DuNkB54M.js';
import { _ as __easycom_4 } from './uv-button.CpuKY_t2.js';
import { _ as __easycom_2 } from './list-cell.BHNnBKKp.js';
import { d as orderDetail, a as orderReceive, p as payUnify } from './order.D8qtvuIN.js';
import { e as ensurePlatformId } from './platformId.BGlVpsd7.js';
import { c as alipayMiniAppLogin } from './auth.CJjHezpF.js';
import './platform.EIa5ETLd.js';

const _sfc_main = {
  __name: 'detail',
  setup(__props) {

	ref("订单详情");
	const loading = ref(true);
	
	// 使用全局导航栏高度
	const { navbarHeightCss } = useNavbarHeight();
	const order = ref({
		id: '',
		orderId: '',
		paid: 0,
		status: 0,
		orderType: '',
		pickupCode: '',
		totalPrice: 0,
		payPrice: 0,
		payPostage: 0,
		couponPrice: 0,
		createTime: '',
		getTime: '',
		deliveryTime: '',
		remark: '',
		preNum: 0,
		refundStatus: 0,
		payType: '',
		shop: {
			name: "",
			mobile: "",
			lat: "",
			lng: "",
			address: "",
			addressMap: ""
		},
		statusDto: {
			payType: "",
		},
		products: [],
		cartInfo: []
	});
	ref(5);

	onLoad((option) => {
		detail(option.id);
	});
	const detail = async (id) => {
		try {
			loading.value = true;
			let data = await orderDetail(id);
			if (data) {
				// 合并数据，保持默认值
				order.value = {
					...order.value,
					...data,
					shop: {
						...order.value.shop,
						...(data.shop || {})
					},
					statusDto: {
						...order.value.statusDto,
						...(data.statusDto || {})
					},
					products: data.products || [],
					cartInfo: data.cartInfo || []
				};
				console.log('订单详情加载成功:', order.value);
			} else {
				console.error('订单详情数据为空');
				showToast({
					title: '订单数据加载失败',
					icon: 'none'
				});
			}
		} catch (error) {
			console.error('加载订单详情失败:', error);
			showToast({
				title: '网络错误，请重试',
				icon: 'none'
			});
		} finally {
			loading.value = false;
		}
	};
	const openLocation$1 = () => {
		let shop = order.value.shop;
		openLocation({
			address: shop.addressMap + shop.address + " " + (shop && shop.name !== undefined && shop.name !==
				null ? shop.name : ''),
			latitude: parseFloat(shop.lat),
			longitude: parseFloat(shop.lng),
			fail(res) {
				console.log(res);
			},
		});
	};
	const makePhoneCall$1 = () => {
		let shop = order.value.shop;
		makePhoneCall({
			phoneNumber: shop.mobile,
			fail(res) {
				console.log(res);
			},
		});
	};

	// 确认收到货
	const receive = async (order) => {
		let data = await orderReceive({
			uni: order.orderId,
		});
		if (data && data.code == 0) {
			await detail(order.id);
		}
	};
	const pay = async () => {
		console.log('will pay');
		console.log(order.value);
		console.log(order.value.payType);
		if (!order.value) {
			console.log('订单不存在');
			return;
		}

		// 支付前确保平台ID存在
		if (order.value.payType === 'weixin' || order.value.payType === 'alipay') {
			const hasPlatformId = await ensurePlatformId('payment');
			if (!hasPlatformId) {
				showToast({
					title: '需要授权后才能支付',
					icon: 'none'
				});
				return;
			}
		}

		if (order.value.payType == 'weixin') {
			// 微信支付
			weixinPay(order.value);
		} else if (order.value.payType == 'yue') {
			// 余额支付
			balancePay(order.value);
		} else if (order.value.payType == 'alipay') {
			// alipay
			aliPay(order.value);
		} else {
			// 其他支付方式
			showToast({
				title: '不支持的支付方式',
				icon: 'none'
			});
			return;
		}
	};
	const balancePay = async () => {

	};
	const getAlipayBuyerId = async () => {
		return new Promise((resolve, reject) => {
			// 获取支付宝用户授权码
			my.getAuthCode({
				scopes: ['auth_user'],
				success: async (res) => {
					console.log('Auth code:', res.authCode);
					try {
						// 使用 auth.js 中的方法
						const result = await alipayMiniAppLogin({
							code: res.authCode
						});
						
						console.log('登录成功:', result);
						if (result && result.buyerId) {
							// 存储 buyer_id
							setStorageSync('buyer_id', result.buyerId);
							resolve(result.buyerId);
						} else {
							console.error('未获取到 buyerId');
							reject(new Error('未获取到 buyerId'));
						}
					} catch (error) {
						console.error('登录失败:', error);
						reject(error);
					}
				},
				fail: (err) => {
					console.error('获取授权码失败:', err);
					reject(err);
				}
			});
		});
	};
	const aliPay = async (order) => {
		try {
			// 确保有 buyerId
			await getAlipayBuyerId();
			
			let from = 'routine';




			let data = await payUnify({
				uni: order.orderId,
				from: from,
				paytype: 'alipay',
				buyer_id: getStorageSync('buyer_id') // 使用存储的 buyer_id
			});

			console.log('alipay result:', data);

			if (!data) {
				hideLoading();
				return;
			}

			if (data.trade_type === 'JSAPI' || data.trade_type === 'JSAPI_PAY') {
				// 支付宝小程序支付
				uni.requestPayment({
					provider: 'alipay',
					orderInfo: data.data, // 支付宝订单信息
					success: function(res) {
						console.log('支付成功:', res);
						// 刷新当前页面的订单信息
						detail(order.id);
						showToast({
							title: '支付成功',
							icon: 'success'
						});
					},
					fail: function(err) {
						console.error('支付失败:', err);
						
						// 详细的错误处理
						let errorMsg = '支付失败';
						if (err.memo && err.memo.includes('API 代理')) {
							errorMsg = '开发环境配置问题，请在支付宝开发者工具中开启API代理';
						} else if (err.resultCode === '4000') {
							errorMsg = '支付环境配置错误';
						} else if (err.resultCode === '6001') {
							errorMsg = '用户取消支付';
						} else if (err.resultCode === '6002') {
							errorMsg = '网络连接出错';
						}
						
						showToast({
							title: errorMsg,
							icon: 'none',
							duration: 3000
						});
					}
				});
			} else {
				console.error('Unsupported trade type for Alipay:', data.trade_type);
				showToast({
					title: '不支持的支付类型',
					icon: 'none'
				});
			}
		} catch (error) {
			console.error('支付宝支付异常:', error);
			hideLoading();
			showToast({
				title: '获取支付授权失败，请重试',
				icon: 'none'
			});
		}
	};
	const weixinPay = async (order) => {
		let from = 'routine';

		from = 'h5';
		if (isWeixin()) {
			from = 'wechat';
		}


		//let that = this;
		let data = await payUnify({
			uni: order.orderId,
			from: from,
			paytype: 'weixin'
		});
		console.log('wxpay result:', data);
		if (!data) {
			hideLoading();
			return;
		}
		if (data.trade_type == 'JSAPI') {
			console.log('param:', data);


			uni.requestPayment({
				provider: 'wxpay',
				timeStamp: data.data.timeStamp,
				nonceStr: data.data.nonceStr,
				package: data.data.package,
				signType: 'MD5',
				paySign: data.data.paySign,
				success: function(res) {
					// uni.removeStorageSync('cart');
					setStorageSync('cart', []);
					switchTab({
						url: '/pages/order/order'
					});
				},
				fail: function(err) {
					console.log('fail:' + JSON.stringify(err));
				}
			});

		}
	};

return (_ctx, _cache) => {
  const _component_uv_loading_icon = resolveEasycom(resolveDynamicComponent("uv-loading-icon"), __easycom_1);
  const _component_v_uni_text = index$i;
  const _component_v_uni_view = index$g;
  const _component_uv_button = resolveEasycom(resolveDynamicComponent("uv-button"), __easycom_4);
  const _component_list_cell = resolveEasycom(resolveDynamicComponent("list-cell"), __easycom_2);
  const _component_v_uni_image = index$q;

  return (openBlock(), createBlock(_component_v_uni_view, {
    class: "container",
    style: normalizeStyle(`padding: 20rpx; padding-top: ${unref(navbarHeightCss)};`)
  }, {
    default: withCtx(() => [
      (loading.value)
        ? (openBlock(), createBlock(_component_v_uni_view, {
            key: 0,
            class: "d-flex justify-content-center align-items-center",
            style: {"height":"400rpx"}
          }, {
            default: withCtx(() => [
              createVNode(_component_uv_loading_icon, {
                mode: "circle",
                color: "#409eff",
                size: "40"
              }),
              createVNode(_component_v_uni_text, { style: {"margin-left":"20rpx","color":"#666"} }, {
                default: withCtx(() => [
                  createTextVNode("订单加载中...")
                ]),
                _: 1
              })
            ]),
            _: 1
          }))
        : (openBlock(), createBlock(_component_v_uni_view, {
            key: 1,
            style: {"padding-bottom":"100rpx"}
          }, {
            default: withCtx(() => [
              createVNode(_component_v_uni_view, { class: "bg-white" }, {
                default: withCtx(() => [
                  (order.value.paid == 0)
                    ? (openBlock(), createBlock(_component_v_uni_view, {
                        key: 0,
                        class: "section d-flex flex-column"
                      }, {
                        default: withCtx(() => [
                          createVNode(_component_v_uni_view, {
                            class: "d-flex flex-column",
                            style: {"margin-bottom":"20rpx","margin-top":"20rpx"}
                          }, {
                            default: withCtx(() => [
                              createVNode(_component_v_uni_view, { style: {"font-size":"30rpx","margin-left":"20rpx","margin-bottom":"20rpx"} }, {
                                default: withCtx(() => [
                                  createTextVNode("待支付")
                                ]),
                                _: 1
                              }),
                              (order.value.paid == 0)
                                ? (openBlock(), createBlock(_component_v_uni_view, {
                                    key: 0,
                                    style: {"margin":"0 20rpx 0"}
                                  }, {
                                    default: withCtx(() => [
                                      createVNode(_component_v_uni_view, { class: "mr-1" }, {
                                        default: withCtx(() => [
                                          (order.value.status == 0)
                                            ? (openBlock(), createBlock(_component_uv_button, {
                                                key: 0,
                                                type: "success",
                                                plain: true,
                                                size: "large",
                                                text: "去支付",
                                                onClick: _cache[0] || (_cache[0] = $event => (pay()))
                                              }))
                                            : createCommentVNode("", true)
                                        ]),
                                        _: 1
                                      })
                                    ]),
                                    _: 1
                                  }))
                                : createCommentVNode("", true)
                            ]),
                            _: 1
                          })
                        ]),
                        _: 1
                      }))
                    : createCommentVNode("", true),
                  createVNode(_component_v_uni_view, { class: "section" }, {
                    default: withCtx(() => [
                      (['takeout','takein'].indexOf(order.value.orderType) > 0)
                        ? (openBlock(), createBlock(_component_list_cell, {
                            key: 0,
                            hover: false
                          }, {
                            default: withCtx(() => [
                              createVNode(_component_v_uni_view, { class: "w-100 d-flex align-items-center" }, {
                                default: withCtx(() => [
                                  createVNode(_component_v_uni_view, { class: "d-flex flex-column w-60" }, {
                                    default: withCtx(() => [
                                      createVNode(_component_v_uni_view, { class: "w-100 font-size-lg text-color-base text-truncate" }, {
                                        default: withCtx(() => [
                                          createTextVNode(toDisplayString((order.value.shop && order.value.shop.name !== undefined && order.value.shop.name !== null) ? order.value.shop.name : 'none'), 1)
                                        ]),
                                        _: 1
                                      })
                                    ]),
                                    _: 1
                                  }),
                                  createVNode(_component_v_uni_view, { class: "d-flex justify-content-end align-items-center w-40" }, {
                                    default: withCtx(() => [
                                      createVNode(_component_v_uni_view, {
                                        class: "iconfont-yshop icon-mobile",
                                        onClick: _cache[1] || (_cache[1] = $event => (makePhoneCall$1(order.value.shop))),
                                        style: {"font-size":"45rpx","margin-right":"40rpx"}
                                      }),
                                      createVNode(_component_v_uni_view, {
                                        class: "iconfont-yshop icon-location",
                                        onClick: _cache[2] || (_cache[2] = $event => (openLocation$1(order.value.shop))),
                                        style: {"font-size":"45rpx"}
                                      })
                                    ]),
                                    _: 1
                                  })
                                ]),
                                _: 1
                              })
                            ]),
                            _: 1
                          }))
                        : createCommentVNode("", true),
                      createVNode(_component_list_cell, {
                        hover: false,
                        padding: "50rpx 30rpx"
                      }, {
                        default: withCtx(() => [
                          createVNode(_component_v_uni_view, { class: "w-100 d-flex flex-column" }, {
                            default: withCtx(() => [
                              createVNode(_component_v_uni_view, { class: "d-flex align-items-center just-content-center" }, {
                                default: withCtx(() => [
                                  createVNode(_component_v_uni_view, { class: "sort-num" }, {
                                    default: withCtx(() => [
                                      createTextVNode(toDisplayString(order.value.pickupCode || '暂无'), 1)
                                    ]),
                                    _: 1
                                  })
                                ]),
                                _: 1
                              }),
                              createVNode(_component_v_uni_view, { class: "d-flex just-content-center" }, {
                                default: withCtx(() => [
                                  createVNode(_component_v_uni_view, { class: "steps d-flex flex-column w-80" }, {
                                    default: withCtx(() => [
                                      createVNode(_component_v_uni_view, { class: "steps__img-column" }, {
                                        default: withCtx(() => [
                                          createVNode(_component_v_uni_view, { class: "steps__img-column-item" }, {
                                            default: withCtx(() => [
                                              (order.value.paid == 1)
                                                ? (openBlock(), createBlock(_component_v_uni_view, {
                                                    key: 0,
                                                    class: "iconfont-yshop icon-lamp"
                                                  }))
                                                : (openBlock(), createBlock(_component_v_uni_view, {
                                                    key: 1,
                                                    class: "iconfont-yshop icon-lamp unactive"
                                                  }))
                                            ]),
                                            _: 1
                                          }),
                                          createVNode(_component_v_uni_view, { class: "steps__img-column-item" }, {
                                            default: withCtx(() => [
                                              (order.value.paid == 1 && order.value.status > 0)
                                                ? (openBlock(), createBlock(_component_v_uni_view, {
                                                    key: 0,
                                                    class: "iconfont-yshop icon-daojishi"
                                                  }))
                                                : (openBlock(), createBlock(_component_v_uni_view, {
                                                    key: 1,
                                                    class: "iconfont-yshop icon-daojishi unactive"
                                                  }))
                                            ]),
                                            _: 1
                                          }),
                                          (order.value.orderType == 'takeout')
                                            ? (openBlock(), createBlock(_component_v_uni_view, {
                                                key: 0,
                                                class: "steps__img-column-item"
                                              }, {
                                                default: withCtx(() => [
                                                  (order.value.status > 1)
                                                    ? (openBlock(), createBlock(_component_v_uni_view, {
                                                        key: 0,
                                                        class: "iconfont-yshop icon-takeout"
                                                      }))
                                                    : (openBlock(), createBlock(_component_v_uni_view, {
                                                        key: 1,
                                                        class: "iconfont-yshop icon-takeout unactive"
                                                      }))
                                                ]),
                                                _: 1
                                              }))
                                            : createCommentVNode("", true),
                                          createVNode(_component_v_uni_view, { class: "steps__img-column-item" }, {
                                            default: withCtx(() => [
                                              (order.value.status > 2)
                                                ? (openBlock(), createBlock(_component_v_uni_view, {
                                                    key: 0,
                                                    class: "iconfont-yshop icon-doorbell"
                                                  }))
                                                : (openBlock(), createBlock(_component_v_uni_view, {
                                                    key: 1,
                                                    class: "iconfont-yshop icon-doorbell unactive"
                                                  }))
                                            ]),
                                            _: 1
                                          })
                                        ]),
                                        _: 1
                                      }),
                                      createVNode(_component_v_uni_view, { class: "steps__text-column" }, {
                                        default: withCtx(() => [
                                          createVNode(_component_v_uni_view, { class: "steps__text-column-item active" }, {
                                            default: withCtx(() => [
                                              createVNode(_component_v_uni_view, { class: "steps__column-item-line bg-transparent" }),
                                              createVNode(_component_v_uni_view, { class: "steps__text-column-item-text" }, {
                                                default: withCtx(() => [
                                                  createTextVNode("已下单")
                                                ]),
                                                _: 1
                                              }),
                                              createVNode(_component_v_uni_view, { class: "steps__column-item-line" })
                                            ]),
                                            _: 1
                                          }),
                                          createVNode(_component_v_uni_view, {
                                            class: normalizeClass(["steps__text-column-item activ", { active: order.value.paid == 1 }])
                                          }, {
                                            default: withCtx(() => [
                                              createVNode(_component_v_uni_view, { class: "steps__column-item-line" }),
                                              createVNode(_component_v_uni_view, { class: "steps__text-column-item-text" }, {
                                                default: withCtx(() => [
                                                  createTextVNode("制作中")
                                                ]),
                                                _: 1
                                              }),
                                              createVNode(_component_v_uni_view, { class: "steps__column-item-line" })
                                            ]),
                                            _: 1
                                          }, 8, ["class"]),
                                          (order.value.orderType == 'takeout')
                                            ? (openBlock(), createBlock(_component_v_uni_view, {
                                                key: 0,
                                                class: normalizeClass(["steps__text-column-item", { active: order.value.status > 1 }])
                                              }, {
                                                default: withCtx(() => [
                                                  createVNode(_component_v_uni_view, { class: "steps__column-item-line" }),
                                                  createVNode(_component_v_uni_view, { class: "steps__text-column-item-text" }, {
                                                    default: withCtx(() => [
                                                      createTextVNode("配送中")
                                                    ]),
                                                    _: 1
                                                  }),
                                                  createVNode(_component_v_uni_view, { class: "steps__column-item-line bg-transparent" })
                                                ]),
                                                _: 1
                                              }, 8, ["class"]))
                                            : createCommentVNode("", true),
                                          createVNode(_component_v_uni_view, {
                                            class: normalizeClass(["steps__text-column-item", { active: order.value.status > 2 }])
                                          }, {
                                            default: withCtx(() => [
                                              createVNode(_component_v_uni_view, { class: "steps__column-item-line" }),
                                              createVNode(_component_v_uni_view, { class: "steps__text-column-item-text" }, {
                                                default: withCtx(() => [
                                                  createTextVNode(toDisplayString(order.value.orderType == "takeout" ? "已送达" : "请取餐"), 1)
                                                ]),
                                                _: 1
                                              }),
                                              createVNode(_component_v_uni_view, { class: "steps__column-item-line bg-transparent" })
                                            ]),
                                            _: 1
                                          }, 8, ["class"])
                                        ]),
                                        _: 1
                                      })
                                    ]),
                                    _: 1
                                  })
                                ]),
                                _: 1
                              }),
                              (order.value.status == 0 && order.value.paid > 0)
                                ? (openBlock(), createBlock(_component_v_uni_view, {
                                    key: 0,
                                    class: "d-flex just-content-center align-items-center font-size-base text-color-assist mb-40"
                                  }, {
                                    default: withCtx(() => [
                                      createTextVNode(" 您前面还有 "),
                                      createVNode(_component_v_uni_text, { class: "text-color-primary mr-10 ml-10" }, {
                                        default: withCtx(() => [
                                          createTextVNode(toDisplayString(order.value.preNum), 1)
                                        ]),
                                        _: 1
                                      }),
                                      createTextVNode(" 单待制作 ")
                                    ]),
                                    _: 1
                                  }))
                                : createCommentVNode("", true),
                              createVNode(_component_v_uni_view, {
                                class: "w-100 d-flex flex-column position-relative mt-30",
                                style: {"margin-bottom":"-40rpx"}
                              }, {
                                default: withCtx(() => [
                                  (openBlock(true), createElementBlock(Fragment, null, renderList(order.value.products, (good, index) => {
                                    return (openBlock(), createBlock(_component_v_uni_view, {
                                      class: "w-100 d-flex align-items-center mb-40",
                                      key: index
                                    }, {
                                      default: withCtx(() => [
                                        createVNode(_component_v_uni_view, { class: "d-flex flex-column w-60 overflow-hidden" }, {
                                          default: withCtx(() => [
                                            createVNode(_component_v_uni_view, { class: "font-size-lg text-color-base mb-10 text-truncate" }, {
                                              default: withCtx(() => [
                                                createTextVNode(toDisplayString(good.title), 1)
                                              ]),
                                              _: 2
                                            }, 1024),
                                            createVNode(_component_v_uni_view, { class: "font-size-sm text-color-assist text-truncate" }, {
                                              default: withCtx(() => [
                                                createTextVNode(toDisplayString(good.spec), 1)
                                              ]),
                                              _: 2
                                            }, 1024)
                                          ]),
                                          _: 2
                                        }, 1024),
                                        createVNode(_component_v_uni_view, { class: "d-flex w-40 align-items-center justify-content-between pl-30" }, {
                                          default: withCtx(() => [
                                            createVNode(_component_v_uni_view, { class: "font-size-base text-color-base" }, {
                                              default: withCtx(() => [
                                                createTextVNode("x" + toDisplayString(good.number), 1)
                                              ]),
                                              _: 2
                                            }, 1024),
                                            createVNode(_component_v_uni_view, { class: "font-size-base text-color-base font-weight-bold" }, {
                                              default: withCtx(() => [
                                                createTextVNode("￥" + toDisplayString(good.price), 1)
                                              ]),
                                              _: 2
                                            }, 1024)
                                          ]),
                                          _: 2
                                        }, 1024)
                                      ]),
                                      _: 2
                                    }, 1024))
                                  }), 128))
                                ]),
                                _: 1
                              })
                            ]),
                            _: 1
                          })
                        ]),
                        _: 1
                      })
                    ]),
                    _: 1
                  }),
                  createVNode(_component_v_uni_view, { class: "section" }, {
                    default: withCtx(() => [
                      createVNode(_component_list_cell, {
                        hover: false,
                        padding: "30rpx 30rpx"
                      }, {
                        default: withCtx(() => [
                          createVNode(_component_v_uni_view, { class: "w-100 d-flex flex-column position-relative" }, {
                            default: withCtx(() => [
                              (openBlock(true), createElementBlock(Fragment, null, renderList(order.value.cartInfo, (good, index) => {
                                return (openBlock(), createBlock(_component_v_uni_view, {
                                  class: "w-100 d-flex align-items-center mb-40",
                                  key: index
                                }, {
                                  default: withCtx(() => [
                                    createVNode(_component_v_uni_image, {
                                      src: good.image,
                                      mode: "aspectFill",
                                      class: "image"
                                    }, null, 8, ["src"]),
                                    createVNode(_component_v_uni_view, { class: "d-flex flex-column w-60 overflow-hidden" }, {
                                      default: withCtx(() => [
                                        createVNode(_component_v_uni_view, { class: "font-size-lg text-color-base mb-10 text-truncate" }, {
                                          default: withCtx(() => [
                                            createTextVNode(toDisplayString(good.title), 1)
                                          ]),
                                          _: 2
                                        }, 1024),
                                        createVNode(_component_v_uni_view, { class: "font-size-sm text-color-assist text-truncate" }, {
                                          default: withCtx(() => [
                                            createTextVNode(toDisplayString(good.spec), 1)
                                          ]),
                                          _: 2
                                        }, 1024)
                                      ]),
                                      _: 2
                                    }, 1024),
                                    createVNode(_component_v_uni_view, { class: "d-flex w-40 align-items-center justify-content-between pl-30" }, {
                                      default: withCtx(() => [
                                        createVNode(_component_v_uni_view, { class: "font-size-base text-color-base" }, {
                                          default: withCtx(() => [
                                            createTextVNode("x" + toDisplayString(good.number), 1)
                                          ]),
                                          _: 2
                                        }, 1024),
                                        createVNode(_component_v_uni_view, { class: "font-size-base text-color-base font-weight-bold" }, {
                                          default: withCtx(() => [
                                            createTextVNode("￥" + toDisplayString(good.price), 1)
                                          ]),
                                          _: 2
                                        }, 1024)
                                      ]),
                                      _: 2
                                    }, 1024)
                                  ]),
                                  _: 2
                                }, 1024))
                              }), 128))
                            ]),
                            _: 1
                          })
                        ]),
                        _: 1
                      }),
                      createVNode(_component_list_cell, {
                        hover: false,
                        padding: "50rpx 30rpx"
                      }, {
                        default: withCtx(() => [
                          createVNode(_component_v_uni_view, { class: "w-100 d-flex flex-column" }, {
                            default: withCtx(() => [
                              createVNode(_component_v_uni_view, { class: "pay-cell" }, {
                                default: withCtx(() => [
                                  createVNode(_component_v_uni_view, null, {
                                    default: withCtx(() => [
                                      createTextVNode("支付方式")
                                    ]),
                                    _: 1
                                  }),
                                  createVNode(_component_v_uni_view, { class: "font-weight-bold" }, {
                                    default: withCtx(() => [
                                      createTextVNode(toDisplayString(order.value.statusDto.payType), 1)
                                    ]),
                                    _: 1
                                  })
                                ]),
                                _: 1
                              }),
                              createVNode(_component_v_uni_view, { class: "pay-cell" }, {
                                default: withCtx(() => [
                                  createVNode(_component_v_uni_view, null, {
                                    default: withCtx(() => [
                                      createTextVNode("订单金额")
                                    ]),
                                    _: 1
                                  }),
                                  createVNode(_component_v_uni_view, { class: "font-weight-bold" }, {
                                    default: withCtx(() => [
                                      createTextVNode("￥" + toDisplayString(order.value.totalPrice), 1)
                                    ]),
                                    _: 1
                                  })
                                ]),
                                _: 1
                              }),
                              (order.value.orderType == 'takeout')
                                ? (openBlock(), createBlock(_component_v_uni_view, {
                                    key: 0,
                                    class: "pay-cell"
                                  }, {
                                    default: withCtx(() => [
                                      createVNode(_component_v_uni_view, null, {
                                        default: withCtx(() => [
                                          createTextVNode("配送费")
                                        ]),
                                        _: 1
                                      }),
                                      createVNode(_component_v_uni_view, { class: "font-weight-bold" }, {
                                        default: withCtx(() => [
                                          createTextVNode("￥" + toDisplayString(order.value.payPostage), 1)
                                        ]),
                                        _: 1
                                      })
                                    ]),
                                    _: 1
                                  }))
                                : createCommentVNode("", true),
                              createVNode(_component_v_uni_view, { class: "pay-cell" }, {
                                default: withCtx(() => [
                                  createVNode(_component_v_uni_view, null, {
                                    default: withCtx(() => [
                                      createTextVNode("优惠金额")
                                    ]),
                                    _: 1
                                  }),
                                  createVNode(_component_v_uni_view, { class: "font-weight-bold" }, {
                                    default: withCtx(() => [
                                      createTextVNode("￥" + toDisplayString(order.value.couponPrice), 1)
                                    ]),
                                    _: 1
                                  })
                                ]),
                                _: 1
                              }),
                              createVNode(_component_v_uni_view, { class: "pay-cell" }, {
                                default: withCtx(() => [
                                  createVNode(_component_v_uni_view, null, {
                                    default: withCtx(() => [
                                      createTextVNode("实付金额")
                                    ]),
                                    _: 1
                                  }),
                                  createVNode(_component_v_uni_view, { class: "font-weight-bold" }, {
                                    default: withCtx(() => [
                                      createTextVNode("￥" + toDisplayString(order.value.payPrice), 1)
                                    ]),
                                    _: 1
                                  })
                                ]),
                                _: 1
                              })
                            ]),
                            _: 1
                          })
                        ]),
                        _: 1
                      })
                    ]),
                    _: 1
                  }),
                  createVNode(_component_v_uni_view, { class: "section" }, {
                    default: withCtx(() => [
                      createVNode(_component_list_cell, {
                        hover: false,
                        padding: "50rpx 30rpx"
                      }, {
                        default: withCtx(() => [
                          createVNode(_component_v_uni_view, { class: "w-100 d-flex flex-column" }, {
                            default: withCtx(() => [
                              createVNode(_component_v_uni_view, { class: "pay-cell" }, {
                                default: withCtx(() => [
                                  createVNode(_component_v_uni_view, null, {
                                    default: withCtx(() => [
                                      createTextVNode("下单时间")
                                    ]),
                                    _: 1
                                  }),
                                  createVNode(_component_v_uni_view, { class: "font-weight-bold" }, {
                                    default: withCtx(() => [
                                      createTextVNode(toDisplayString(order.value.createTime), 1)
                                    ]),
                                    _: 1
                                  })
                                ]),
                                _: 1
                              }),
                              (order.value.shop)
                                ? (openBlock(), createBlock(_component_v_uni_view, {
                                    key: 0,
                                    class: "pay-cell"
                                  }, {
                                    default: withCtx(() => [
                                      createVNode(_component_v_uni_view, null, {
                                        default: withCtx(() => [
                                          createTextVNode("下单门店")
                                        ]),
                                        _: 1
                                      }),
                                      createVNode(_component_v_uni_view, { class: "font-weight-bold" }, {
                                        default: withCtx(() => [
                                          createTextVNode(toDisplayString((order.value.shop && order.value.shop.name !== undefined && order.value.shop.name !== null) ? order.value.shop.name : 'none'), 1)
                                        ]),
                                        _: 1
                                      })
                                    ]),
                                    _: 1
                                  }))
                                : createCommentVNode("", true),
                              createVNode(_component_v_uni_view, { class: "pay-cell" }, {
                                default: withCtx(() => [
                                  createVNode(_component_v_uni_view, null, {
                                    default: withCtx(() => [
                                      createTextVNode("订单号")
                                    ]),
                                    _: 1
                                  }),
                                  createVNode(_component_v_uni_view, { class: "font-weight-bold" }, {
                                    default: withCtx(() => [
                                      createTextVNode(toDisplayString(order.value.orderId), 1)
                                    ]),
                                    _: 1
                                  })
                                ]),
                                _: 1
                              })
                            ]),
                            _: 1
                          })
                        ]),
                        _: 1
                      })
                    ]),
                    _: 1
                  }),
                  (order.value.orderType == 'take_out' || order.value.orderType == 'take_in')
                    ? (openBlock(), createBlock(_component_list_cell, {
                        key: 1,
                        hover: false,
                        padding: "50rpx 30rpx 20rpx",
                        last: ""
                      }, {
                        default: withCtx(() => [
                          createVNode(_component_v_uni_view, { class: "w-100 d-flex flex-column" }, {
                            default: withCtx(() => [
                              createVNode(_component_v_uni_view, { class: "pay-cell" }, {
                                default: withCtx(() => [
                                  createVNode(_component_v_uni_view, null, {
                                    default: withCtx(() => [
                                      createTextVNode("享用方式")
                                    ]),
                                    _: 1
                                  }),
                                  createVNode(_component_v_uni_view, { class: "font-weight-bold" }, {
                                    default: withCtx(() => [
                                      createTextVNode(toDisplayString(order.value.orderType == "takein" ? "自取" : "外卖"), 1)
                                    ]),
                                    _: 1
                                  })
                                ]),
                                _: 1
                              }),
                              createVNode(_component_v_uni_view, { class: "pay-cell" }, {
                                default: withCtx(() => [
                                  createVNode(_component_v_uni_view, null, {
                                    default: withCtx(() => [
                                      createTextVNode("取餐时间")
                                    ]),
                                    _: 1
                                  }),
                                  createVNode(_component_v_uni_view, { class: "font-weight-bold" }, {
                                    default: withCtx(() => [
                                      createTextVNode(toDisplayString(order.value.getTime ? order.value.getTime : "立即取餐"), 1)
                                    ]),
                                    _: 1
                                  })
                                ]),
                                _: 1
                              }),
                              createVNode(_component_v_uni_view, { class: "pay-cell" }, {
                                default: withCtx(() => [
                                  createVNode(_component_v_uni_view, null, {
                                    default: withCtx(() => [
                                      createTextVNode("制作完成时间")
                                    ]),
                                    _: 1
                                  }),
                                  createVNode(_component_v_uni_view, { class: "font-weight-bold" }, {
                                    default: withCtx(() => [
                                      createTextVNode(toDisplayString(order.value.deliveryTime ? order.value.deliveryTime : "无"), 1)
                                    ]),
                                    _: 1
                                  })
                                ]),
                                _: 1
                              }),
                              createVNode(_component_v_uni_view, { class: "pay-cell" }, {
                                default: withCtx(() => [
                                  createVNode(_component_v_uni_view, null, {
                                    default: withCtx(() => [
                                      createTextVNode("备注")
                                    ]),
                                    _: 1
                                  }),
                                  createVNode(_component_v_uni_view, { class: "font-weight-bold" }, {
                                    default: withCtx(() => [
                                      createTextVNode(toDisplayString(order.value.remark ? order.value.remark : "无"), 1)
                                    ]),
                                    _: 1
                                  })
                                ]),
                                _: 1
                              })
                            ]),
                            _: 1
                          })
                        ]),
                        _: 1
                      }))
                    : createCommentVNode("", true)
                ]),
                _: 1
              }),
              (order.value.paid > 0 && order.value.refundStatus == 0)
                ? (openBlock(), createBlock(_component_v_uni_view, {
                    key: 0,
                    class: "fixed-bottom flex justify-end bg-white p-2"
                  }, {
                    default: withCtx(() => [
                      createVNode(_component_v_uni_view, { class: "mr-1" }, {
                        default: withCtx(() => [
                          (order.value.status < 2)
                            ? (openBlock(), createBlock(_component_uv_button, {
                                key: 0,
                                type: "success",
                                plain: true,
                                size: "small",
                                text: "确认收到餐",
                                onClick: _cache[3] || (_cache[3] = $event => (receive(order.value)))
                              }))
                            : createCommentVNode("", true)
                        ]),
                        _: 1
                      })
                    ]),
                    _: 1
                  }))
                : createCommentVNode("", true)
            ]),
            _: 1
          }))
    ]),
    _: 1
  }, 8, ["style"]))
}
}

};
const detail = /*#__PURE__*/_export_sfc(_sfc_main, [['__scopeId',"data-v-40670806"]]);

export { detail as default };
